package com.gitee.wsl.struct.either.ext

import arrow.core.Either
import arrow.core.getOrElse

/**
 * Retrieves the Right hand of an Either, or throws the Left hand error
 */
fun <A> Either<Throwable, A>.orThrow() = this.getOrElse { t -> throw t }
